import turtle

digits = {'0': [(0, 60), (30, 90), (150, 90), (180, 60), (150, 30), (30, 30)],
          '1': [(60, 90), (90, 60), (90, 30)],
          '2': [(0, 60), (60, 60), (90, 90), (90, 120), (60, 150), (0, 150)],
          '3': [(0, 60), (60, 60), (90, 90), (60, 120), (0, 120)],
          '4': [(90, 120), (90, 90), (0, 90), (60, 60), (90, 30)],
          '5': [(0, 60), (0, 90), (90, 90), (90, 120), (0, 120)],
          '6': [(0, 60), (0, 30), (60, 30), (90, 60), (90, 90), (60, 120), (0, 120)],
          '7': [(0, 60), (60, 60), (90, 90), (30, 120)],
          '8': [(0, 60), (30, 90), (60, 60), (90, 90), (60, 120), (30, 150), (0, 120)],
          '9': [(0, 90), (0, 60), (30, 60), (60, 90), (60, 120), (30, 150), (0, 120)]}

def draw_digit(num, color):
    turtle.pencolor(color)
    turtle.penup()
    for position in digits[num]:
        turtle.setpos(position)
        turtle.pendown()
    turtle.penup()

def main():
    turtle.setup(500, 500)
    turtle.bgcolor("black")
    turtle.speed(0)
    turtle.hideturtle()

    num = input("请输入数字（0-9）：")
    color = input("请输入颜色（green/blue/red/yellow）：")

    for i in num:
        if i in digits:
            draw_digit(i, color)
            turtle.forward(100)

    turtle.done()

if __name__ == '__main__':
    main()
